Auto merge of #2679 - sbeckeriv:alias, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 13 Jul 2016 18:36:44 +0000 (11:36 -0700)
committerGitHub <noreply@github.com>
Wed, 13 Jul 2016 18:36:44 +0000 (11:36 -0700)
Command alias or Alias command #1091

Dearest Reviewer,

This pull request closes #1091 which is a request to support aliases.
This is not as powerful as something like git's alias, however, I think
it sticks true to the original request.

I high jack the processing of the args. After a few flags are checked
and the args are parsed I check the config file for alias.COMMAND. If it
is there I split it like args does and replace args[1] (the original
command) with the alias command and its 'flags'.

As an extra measure I output the alias command with warn. I would be
willing to drop that or put it behind a verbose flag. Also the docs have
been updated.

Thanks!
Becker

<img width="784" alt="screen shot 2016-05-12 at 10 23 59 am" src="https://cloud.githubusercontent.com/assets/12170/15226012/d18a3336-1835-11e6-94c9-875a63a79856.png">

1  2 
src/bin/cargo.rs
src/doc/config.md

Simple merge
index 551e534eb20126491403c5ed5fe5f786f9a6f4f6,538b31822e093686c79e378878ec010e8fc41c93..d091633b1d14c15b9c106a8dc61fa15f8dceb55f
@@@ -93,9 -93,18 +93,18 @@@ color = 'auto'         # whether cargo 
  # Network configuration
  [net]
  retry = 2 # number of times a network call will automatically retried
+ # Alias cargo commands. The first 3 aliases are built in. If your
+ command requires grouped whitespace use the list format.
+ [alias]
+ b = "build"
+ t = "test"
+ r = "run"
+ rr = "run --release"
+ space_example = ["run", "--release", "--", "\"command list\""]
  ```
  
 -# Environment Variables
 +# Environment variables
  
  Cargo can also be configured through environment variables in addition to the
  TOML syntax above. For each configuration key above of the form `foo.bar` the